/**   
 * @Title: YinLianCommunicater.java 
 * @Package: com.esun.rabbit2.communicaters.shoujiyinlian 
 * @Description: 手机银联支付通信接口 
 * @Author: Kael gaojian@500wan.com   
 * @Date: 2012-5-30 上午10:29:35 
 * Copyright (C) 2011 Shenzhen E-sun Sky Net Technology Co.,ltd.
 */
package com.esun.rabbit2.communicaters.recharg;

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Hashtable;

import javax.xml.parsers.ParserConfigurationException;

import org.apache.http.client.ClientProtocolException;
import org.xml.sax.SAXException;

import com.esun.config.BussinessCode;
import com.esun.config.DistributionChannels;
import com.esun.config.Key;
import com.esun.network.ServerCommunicater;
import com.esun.util.HashMapUtil;

/** 
* @ClassName: YinLianCommunicater 
* @Description: 手机银联支付通信接口
* @author: Kael gaojian@500wan.com
* @date: 2012-5-30 上午10:29:35 
*  
*/
public class YinLianCommunicater extends ServerCommunicater{
	private boolean isSucceed = false;
	public boolean succeed (String username, String password, String merchantOrderAmt ,String version) throws ClientProtocolException, IOException,
	ParserConfigurationException, SAXException {
		ArrayList<HashMap<String, String>> list = new ArrayList<HashMap<String, String>>();
		list.add(HashMapUtil.getMapItem(BussinessCode.PASER_MID, BussinessCode.MID_PHONE_RECHARGE));//接口号
		list.add(HashMapUtil.getMapItem(Key.KEY_CHANNEL, DistributionChannels.QUDAO));//渠道号
		list.add(HashMapUtil.getMapItem(Key.KEY_VERSION, version));//版本号
		list.add(HashMapUtil.getMapItem(Key.KEY_USERNAME, username));//用户名
		list.add(HashMapUtil.getMapItem(Key.KEY_PASSWORD, password));//用户密码
		list.add(HashMapUtil.getMapItem(Key.KEY_MERCHANTORDERAMT, merchantOrderAmt));//充值金额
		super.getServerResponse(list, true);
		if(super.getState() == 100) {
			isSucceed = true;
		}else {
			isSucceed = false;
		}
		return isSucceed;
	}
	public Hashtable <String,String> getYinLianInfo () {
		Hashtable<String,String>hashtable = new Hashtable<String,String>();
		hashtable = super.getResult();
		return hashtable;
	}

}
